// Tests if a number is Palindrome
// By DreamVB 23:18 25/09/2016

#include <iostream>
#include <fstream>
#include <Windows.h>

using namespace std;
using std::cout;
using std::endl;

int NumIsPalindrome(int number){
	int num = 0;
	int tmp = number;

	while (number != 0){
		//Mult num by 10
		num *= 10;
		//get any remainders
		num += number % 10;
		//Keep dividing the source number by 10
		number /= 10;
	}
	return num == tmp;
}

int main(int argc, char *argv[]){
	//Test if number is palindrome
	cout << "Is palindrome 121  : " << NumIsPalindrome(121) << endl;
	cout << "Is palindrome 35   : " << NumIsPalindrome(35) << endl;
	cout << "Is palindrome 65   : " << NumIsPalindrome(65) << endl;
	cout << "Is palindrome 464  : " << NumIsPalindrome(464) << endl;

	system("pause");
	return 0;
}